package com.etc.clonedemo;

public class Boy  implements  Cloneable{
    private String name;

    //这个男生有一个女朋友
    private GirlFriend girlFriend;

    public Boy() {
    }

    public Boy(String name, GirlFriend girlFriend) {
        this.name = name;
        this.girlFriend = girlFriend;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public GirlFriend getGirlFriend() {
        return girlFriend;
    }

    public void setGirlFriend(GirlFriend girlFriend) {
        this.girlFriend = girlFriend;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Boy{" +
                "name='" + name + '\'' +
                ", girlFriend=" + girlFriend +
                '}';
    }
}
